<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Admins</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class Admins</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
											<a href="#sec-const-summary">Constants</a> (<a href="#sec-consts">details</a>)
						
			</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Administrator log in/out handling model.</p>
	<ul class="tags">
				<li><span class="field">author:</span> Andrej Jursa, Michal Palenik</li>
				<li><span class="field">version:</span> 1.0</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_models---admins.php.html">/models/admins.php</a> (line <span class="field"><a href="../__filesource/fsource_AppModels__modelsadmins.php.html#a10">10</a></span>)
		</p>
		
				
		<pre>CI_Model
   |
   --Admins</pre>
	
			</div>
</div>


	<a name="sec-const-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Class Constant Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Constants</span> (<a href="#sec-consts">details</a>)
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<div class="const-summary">
								<div class="const-title">
					<a href="#USER_DATA_STRING" title="details" class="const-name">USER_DATA_STRING</a> = 					<span class="var-type"> 'logged_in_admin'</span>

				</div>
							</div>
		</div>
	</div>


	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-const-summary">Constants</a> (<a href="#sec-consts">details</a>)
							
									<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																																																																				
												<div class="method-definition">
											<span class="method-result">Admins</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#adminExists" title="details" class="method-name">adminExists</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$email</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#getAdminEmail" title="details" class="method-name">getAdminEmail</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">integer</span>
										<a href="#getAdminId" title="details" class="method-name">getAdminId</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#getIdByEmail" title="details" class="method-name">getIdByEmail</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$email</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#getIdByValidToken" title="details" class="method-name">getIdByValidToken</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$token</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">boolean</span>
										<a href="#isAdminLogedIn" title="details" class="method-name">isAdminLogedIn</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">boolean</span>
										<a href="#loginAdmin" title="details" class="method-name">loginAdmin</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$email</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$password</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">boolean</span>
										<a href="#logoutAdmin" title="details" class="method-name">logoutAdmin</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">bolean</span>
										<a href="#updateEmail" title="details" class="method-name">updateEmail</a>
											(<span class="var-type">int</span>&nbsp;<span class="var-name">$id</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$email</span> = <span class="var-default">NULL</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">bolean</span>
										<a href="#updateNewEmail" title="details" class="method-name">updateNewEmail</a>
											(<span class="var-type">int</span>&nbsp;<span class="var-name">$id</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$email</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$validation_token</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#updatePassword" title="details" class="method-name">updatePassword</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$pass</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#updateSessionData" title="details" class="method-name">updateSessionData</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#updateValidToken" title="details" class="method-name">updateValidToken</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$token</span>)
									</div>
								</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-const-summary">Constants</a> (<a href="#sec-consts">details</a>)
							
										<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>

<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">Constructor __construct</span> (line <span class="line-number"><a href="../__filesource/fsource_AppModels__modelsadmins.php.html#a17">17</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Admins</span>
		<span class="method-name">
			__construct
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodadminExists" id="adminExists"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">adminExists</span> (line <span class="line-number"><a href="../__filesource/fsource_AppModels__modelsadmins.php.html#a117">117</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Verifies if entered email exists in table admins.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			adminExists
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$email</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$email</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetAdminEmail" id="getAdminEmail"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getAdminEmail</span> (line <span class="line-number"><a href="../__filesource/fsource_AppModels__modelsadmins.php.html#a91">91</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns administrator e-mail or NULL if no administrator is loged in.</p>
	<ul class="tags">
				<li><span class="field">return:</span> administrator e-mail.</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getAdminEmail
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetAdminId" id="getAdminId"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getAdminId</span> (line <span class="line-number"><a href="../__filesource/fsource_AppModels__modelsadmins.php.html#a78">78</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns administrator id or NULL if no administrator is loged in.</p>
	<ul class="tags">
				<li><span class="field">return:</span> administrator id.</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">integer</span>
		<span class="method-name">
			getAdminId
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetIdByEmail" id="getIdByEmail"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getIdByEmail</span> (line <span class="line-number"><a href="../__filesource/fsource_AppModels__modelsadmins.php.html#a194">194</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			getIdByEmail
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$email</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$email</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetIdByValidToken" id="getIdByValidToken"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getIdByValidToken</span> (line <span class="line-number"><a href="../__filesource/fsource_AppModels__modelsadmins.php.html#a200">200</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			getIdByValidToken
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$token</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$token</span>			</li>
				</ul>
		
			
	</div>
<a name="methodisAdminLogedIn" id="isAdminLogedIn"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">isAdminLogedIn</span> (line <span class="line-number"><a href="../__filesource/fsource_AppModels__modelsadmins.php.html#a67">67</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Verifies if administrator is loged in.</p>
	<ul class="tags">
				<li><span class="field">return:</span> returns TRUE if there is valid login, FALSE otherwise.</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">boolean</span>
		<span class="method-name">
			isAdminLogedIn
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodloginAdmin" id="loginAdmin"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">loginAdmin</span> (line <span class="line-number"><a href="../__filesource/fsource_AppModels__modelsadmins.php.html#a30">30</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Performs admin login and set up session information.</p>
<p class="description"><p>Does nothing and return FALSE when administrator is already loged in.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> TRUE, when login attempt were successful, FALSE otherwise or when administrator is already loged in.</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">boolean</span>
		<span class="method-name">
			loginAdmin
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$email</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$password</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$email</span><span class="var-description">: administrator e-mail.</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$password</span><span class="var-description">: administrator password.</span>			</li>
				</ul>
		
			
	</div>
<a name="methodlogoutAdmin" id="logoutAdmin"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">logoutAdmin</span> (line <span class="line-number"><a href="../__filesource/fsource_AppModels__modelsadmins.php.html#a104">104</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Log out administrator.</p>
	<ul class="tags">
				<li><span class="field">return:</span> TRUE on success, FALSE when no administrator is loged in.</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">boolean</span>
		<span class="method-name">
			logoutAdmin
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodupdateEmail" id="updateEmail"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">updateEmail</span> (line <span class="line-number"><a href="../__filesource/fsource_AppModels__modelsadmins.php.html#a176">176</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Set value 'email' to 'new_email' and 'new_email' and 'validation_token' to &quot;&quot;</p>
	<ul class="tags">
				<li><span class="field">return:</span> True if email is updated or False when fails.</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bolean</span>
		<span class="method-name">
			updateEmail
		</span>
					(<span class="var-type">int</span>&nbsp;<span class="var-name">$id</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$email</span> = <span class="var-default">NULL</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$id</span><span class="var-description">: Id of admin</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$email</span><span class="var-description">: new email</span>			</li>
				</ul>
		
			
	</div>
<a name="methodupdateNewEmail" id="updateNewEmail"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">updateNewEmail</span> (line <span class="line-number"><a href="../__filesource/fsource_AppModels__modelsadmins.php.html#a159">159</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Upadtes 'new_email' and 'validation_token' of admin with $id.</p>
	<ul class="tags">
				<li><span class="field">return:</span> True if email is updated or False when fails.</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bolean</span>
		<span class="method-name">
			updateNewEmail
		</span>
					(<span class="var-type">int</span>&nbsp;<span class="var-name">$id</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$email</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$validation_token</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$id</span><span class="var-description">: Id of admin</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$email</span><span class="var-description">: new email</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$validation_token</span><span class="var-description">: token for validation</span>			</li>
				</ul>
		
			
	</div>
<a name="methodupdatePassword" id="updatePassword"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">updatePassword</span> (line <span class="line-number"><a href="../__filesource/fsource_AppModels__modelsadmins.php.html#a143">143</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Upadtes password of admin with $id.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			updatePassword
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$pass</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$id</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$pass</span>			</li>
				</ul>
		
			
	</div>
<a name="methodupdateSessionData" id="updateSessionData"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">updateSessionData</span> (line <span class="line-number"><a href="../__filesource/fsource_AppModels__modelsadmins.php.html#a50">50</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Performs update of session data, only if there is valid administrator login.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			updateSessionData
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodupdateValidToken" id="updateValidToken"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">updateValidToken</span> (line <span class="line-number"><a href="../__filesource/fsource_AppModels__modelsadmins.php.html#a131">131</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Updates Validation Token for admin with $id.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			updateValidToken
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$token</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$id</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$token</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>

	<a name="sec-consts"></a>
	<div class="info-box">
		<div class="info-box-title">Class Constants</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Constants</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="constUSER_DATA_STRING" id="USER_DATA_STRING"><!-- --></A>
<div class="evenrow">

	<div class="const-header">
		<span class="const-title">
			<span class="const-name">USER_DATA_STRING</span>
			 = <span class="const-default"> 'logged_in_admin'</span>
			(line <span class="line-number"><a href="../__filesource/fsource_AppModels__modelsadmins.php.html#a15">15</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> key in session user data.</li>
			</ul>
	
	
</div>
						
		</div>
	</div>

	<p class="notes" id="credit">
		Documentation generated on Tue, 15 Jan 2013 16:53:59 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.4</a>
	</p>
	</div></body>
</html>